Re: Use à Python 2 module with Python 3

2015-03-11 Thread Michael Parchet
Hello,

The pyside project is ded.
Dose pyqt4 support Python 3 ?
Thanks for your answer
Best regards
mparchet 



> Le 10 mars 2015 à 01:20, Michael Torrie  a écrit :
> 
>> On 03/09/2015 05:47 PM, Steven D'Aprano wrote:
>> Michael Parchet wrote:
>> 
>>> Hello,
>>> 
>>> For a new project, a person recommande me to use Python 3
>>> 
>>> can I use Python 3 with a Python 2 y module ex : pyQt 4 ?
>> 
>> Maybe.
>> 
>> If the module is really only Python 2, then no. If it is pure-Python, with
>> no C extensions, then you might be able to fork it and update it to work
>> with Python 3. The 2to3 tool may help with that.
>> 
>> If a module's documentation says it works with Python 2, but doesn't mention
>> Python 3 at all, it *might* work with Python 3. The author or maintainer of
>> the project simply hasn't gotten around to fixing the documentation. So it
>> may be worth just trying it and seeing for yourself.
>> 
>> For PyQt specifically, googling suggests that PyQt does work with Python 3,
>> but the documentation is out of date and you may have difficulty installing
>> it:
>> 
>> https://www.google.com.au/search?q=pyqt+python3
> 
> PySide does support Python 3.  Last time I installed it, I think it did
> it with pip.  It will require a working C++ compiler to install it.
> Both PyQt and PySide are not pure python. They have bridging code that
> must be compiled.
> -- 
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Use à Python 2 module with Python 3

2015-03-11 Thread Steven D'Aprano
Michael Parchet wrote:

> Hello,
> 
> The pyside project is ded.

What makes you think that Pyside is dead? It seems to be active to me. The
latest update was just 29 days ago:

https://github.com/PySide

PySide supports Python 3:

http://qt-project.org/wiki/PySide_Python_3_Support


> Dose pyqt4 support Python 3 ?

I can only repeat what I already wrote a few days ago:

For PyQt specifically, googling suggests that PyQt does work with Python
3, but the documentation is out of date and you may have difficulty
installing it:

https://www.google.com.au/search?q=pyqt+python3



-- 
Steven

-- 
https://mail.python.org/mailman/listinfo/python-list


[ANN] Pylint 1.4.2 / Astroid 1.3.5 released

2015-03-11 Thread Claudiu Popa
Hello,


I'm happy to announce the release of Pylint 1.4.2 and astroid 1.3.5.

The following changes were included in these releases:

For pylint:

* Don't require a docstring for empty modules. Closes issue #261.

* Fix a false positive with `too-few-format-args` string warning,
  emitted when the string format contained a normal positional
  argument ('{0}'), mixed with a positional argument which did
  an attribute access ('{0.__class__}').
  Closes issue #463.

* Take in account all the methods from the ancestors
  when checking for too-few-public-methods. Closes issue #471.

* Catch enchant errors and emit 'invalid-characters-in-docstring'
  when checking for spelling errors. Closes issue #469.

* Use all the inferred statements for the super-init-not-called
  check. Closes issue #389.

* Add a new warning, 'unichr-builtin', emitted by the Python 3
  porting checker, when the unichr builtin is found. Closes issue #472.

* Add a new warning, 'intern-builtin', emitted by the Python 3
  porting checker, when the intern builtin is found. Closes issue #473.

* Add support for editable installations.

* The HTML output accepts the `--msg-template` option. Patch by
  Dan Goldsmith.

* Add 'map-builtin-not-iterating' (replacing 'implicit-map-evaluation'),
  'zip-builtin-not-iterating', 'range-builtin-not-iterating', and
  'filter-builtin-not-iterating' which are emitted by `--py3k` when the
  appropriate built-in is not used in an iterating context (semantics
  taken from 2to3).

* Add a new warning, 'unidiomatic-typecheck', emitted when an explicit
  typecheck uses type() instead of isinstance(). For example,
  `type(x) == Y` instead of `isinstance(x, Y)`. Patch by Chris Rebert.
  Closes issue #299.

* Add support for combining the Python 3 checker mode with the --jobs
  flag (--py3k and --jobs). Closes issue #467.

* Add a new warning for the Python 3 porting checker, 'using-cmp-argument',
  emitted when the `cmp` argument for the `list.sort` or `sorted builtin`
  is encountered.

* Make the --py3k flag commutative with the -E flag. Also, this patch
  fixes the leaks of error messages from the Python 3 checker when
  the errors mode was activated. Closes issue #437.

For astroid:

* Add the ability to optimize small ast subtrees,
  with the first use in the optimization of multiple
  BinOp nodes. This removes recursivity in the rebuilder
  when dealing with a lot of small strings joined by the
  addition operator. Closes issue #59.

* Obtain the methods for the nose brain tip through an
  unittest.TestCase instance. Closes Pylint issue #457.

* Fix a crash which occurred when a class was the ancestor
  of itself. Closes issue #78.

* Improve the scope_lookup method for Classes regarding qualified
  objects, with an attribute name exactly as one provided in the
  class itself.

  For example, a class containing an attribute 'first',
  which was also an import and which had, as a base, a qualified name
  or a Gettattr node, in the form 'module.first', then Pylint would
  have inferred the `first` name as the function from the Class,
  not the import. Closes Pylint issue #466.

* Implement the assigned_stmts operation for Starred nodes,
  which was omitted when support for Python 3 was added in astroid.
  Closes issue #36.


If you find any bugs, don't hesitate to open a new issue on our issue tracker.


Enjoy!
-- 
https://mail.python.org/mailman/listinfo/python-list


Urgent Need for Sr QE Automation Consultant - Sunnyvale CA (Local candidates ONLY)

2015-03-11 Thread tiya . akrid
Hello,
 
We have below position for one of the leading online retailer of sports 
merchandise. Let me know if you have LOCAL candidates. Please send resume with 
all the details asked below.
 
Job title: Software Engineer in Quality
Location: Sunnyvale, CA
Rate: Open for the right candidate
Type: 6 months +contract 
Interview Process: Onsite Only
 
Responsibilities:
-  Work on an existing application in the Marketing Science team 
focused on maintaining internal application as well making enhancements and new 
features to the system.
-  Initially focus on quality by creating test plans, test data, data 
validation SQL scripts and analyze test results and then automate some of the 
testing and quality checks
-  Adding more integration to new channels and sources of data via web 
services as well as custom data feeds
-  Work closely with marketing business and technology teams and 
provide on-going support and guidance.
-  Develop scalable and reusable processes and automation frameworks 
for analyzing data and delivering ongoing quality metrics (leveraging SQL, PL 
SQL, UNIX, PYTHON and other tools)
 
Required Skills and Experience:
-  3 - 8 years' experience developing and testing highly distributed, 
complex eCommerce Platforms
-  At least 3 years hands-on software programming, Automation 
Scripting, White box testing experience
-  Python scripting experience, strong knowledge and experience in 
automated testing (API testing preferred), someone who has experience working 
in an Agile development environment, and someone who is comfortable owning the 
testing for a feature or project and working directly with API developers
-  Extensive hands-on QA & white box testing, and automation.
-  Nice to have - string prior QE , Python scripting
-  Hands-on experience working with relational DB  ( Oracle, MySQL, 
PostgreSQL) as well NoSQL DB such as Cassandra, Redshift
 

Please send your word format resume along with below details for further process
Software Programming ___ years of experience
Automation Scripting ___ years of experience
WhiteBox testing ___ years of experience
Python Scripting ___ years of experience
Relational DB ___ years of experience
Rates on c2c 
Availability
Current Location
Visa Status
 
Regards

Tiya
Akrid Software Inc
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Use à Python 2 module with Python 3

2015-03-11 Thread Michael Torrie
On 03/11/2015 03:28 AM, Michael Parchet wrote:
> The pyside project is ded.

Why do you say PySide is dead?

> Dose pyqt4 support Python 3 ?
> Thanks for your answer
> Best regards
> mparchet 

Riverbank Computing has a web page that I'm sure has information on
their PyQt product. (Yes PyQt is a commercial product with a GPL version).
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Use à Python 2 module with Python 3

2015-03-11 Thread Michael Torrie
On 03/11/2015 04:54 AM, Steven D'Aprano wrote:
>> Dose pyqt4 support Python 3 ?
> 
> I can only repeat what I already wrote a few days ago:
> 
> For PyQt specifically, googling suggests that PyQt does work with Python
> 3, but the documentation is out of date and you may have difficulty
> installing it:
> 
> https://www.google.com.au/search?q=pyqt+python3

Yes apparently his google is broken.  Here is the official site for PyQt
that may have the information he seeks:

http://www.riverbankcomputing.com/software/pyqt/download

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: I want to get involved with Python!

2015-03-11 Thread Jacob Kruger
  - Original Message - 
  From: bink...@mweb.co.za 
  To: python-list@python.org 
  Sent: Wednesday, March 11, 2015 11:19 AM
  Subject: I want to get involved with Python!


  > Please advise on what route you would suggest I take to become a Python > > 
developer!
  > 
  > Thanks,
  > Bianca.

  Bianca, best bet to check out availability of positions in SA is to check out 
online job listing websites, like careers24, pnet and jobmail, etc.

  And, while have no idea about other forms of training, I just got into python 
by working through various forms of online tutorial material, etc., as well as 
working with some of the eBooks available - but, sure some of the other list 
members will have better/more specific suggestions in that regard.

  And, yes, I work in/with python, but, my other primary field of focus here in 
SA is web development, so not too sure about industry specific use of different 
languages/platforms.

  Stay well

  Jacob Kruger
  Blind Biker
  Skype: BlindZA
  "Roger Wilco wants to welcome you...to the space janitor's closet..."
-- 
https://mail.python.org/mailman/listinfo/python-list


when may sys.executable be empty

2015-03-11 Thread Wolfgang Maier

From the documentation of sys.executable:

A string giving the absolute path of the executable binary for the 
Python interpreter, on systems where this makes sense. If Python is 
unable to retrieve the real path to its executable, sys.executable will 
be an empty string or None.


So on which systems does it not make sense ?

Thanks for any help,
Wolfgang

--
https://mail.python.org/mailman/listinfo/python-list


RE: Re: I want to get involved with Python!

2015-03-11 Thread bink...@mweb.co.za
Jacob, thanks for replying. The IT job market is s specific in what they 
are looking for here in SA and it is really hard to get a job in a programming 
language one hasn't been exposed to. Even when you explain to the agency that 
you want to learn new technologies and that the only way you can acquire it is 
if someone gives you a chance. The recruitment agencies blatantly block your CV 
for those positions and it never gets to the clients. So, I thought it best to 
subscribe to this mail forum and hopefully get some advice and comments.
I will continue applying online though.
From: ja...@blindza.co.za
Sent: 2015/03/11 03:48:23 PM
To: bink...@mweb.co.za,python-list@python.org
Cc:
Subject: RE: Re: I want to get involved with Python!   - Original Message 
- From:bink...@mweb.co.zato:python-list@python.orgSent: Wednesday, March 
11, 2015 11:19 AMSubject: I want to get involved with Python!
> Please advise on what route you would suggest I take to become a Python > > 
> developer!
> 
> Thanks,
> Bianca.
Bianca, best bet to check out availability of positions in SA is to check out 
online job listing websites, like careers24, pnet and jobmail, etc. And, while 
have no idea about other forms of training, I just got into python by working 
through various forms of online tutorial material, etc., as well as working 
with some of the eBooks available - but, sure some of the other list members 
will have better/more specific suggestions in that regard. And, yes, I work 
in/with python, but, my other primary field of focus here in SA is web 
development, so not too sure about industry specific use of different 
languages/platforms. Stay well
Jacob Kruger
Blind Biker
Skype: BlindZA
"Roger Wilco wants to welcome you...to the space janitor's closet..."
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Re: I want to get involved with Python!

2015-03-11 Thread Jacob Kruger
  - Original Message - 
  From: bink...@mweb.co.za 
  To: ja...@blindza.co.za 
  Cc: python-list@python.org 
  Sent: Wednesday, March 11, 2015 4:10 PM
  Subject: RE: Re: I want to get involved with Python!


  >  Jacob, thanks for replying. The IT job market is s specific in what 
they >  are looking for here in SA and it is really hard to get a job in a 
programming >  language one hasn't been exposed to. Even when you explain to 
the agency >  that you want to learn new technologies and that the only way you 
can >  >  >  >  acquire it is if someone gives you a chance. The recruitment 
agencies >  >  >  blatantly block your CV for those positions and it never gets 
to the clients. 

  Bianca, I know that too well - however, the one reason I got my current 
position was that while it primarily involves having PHP/web development 
abilities, they also specifically wanted a broader range of areas of 
experience, specifically including python, along with a couple of other 
languages/platforms, etc., but, it's not too common in that sense.

  Alternatively, UCT has recently started offering forms of online, location 
non-specific courses, relating to forms of certification qualifications, as 
well as learning, and think they might include offering some courses relating 
to python, etc. - and, while it's a form of remote learning, it is also a local 
education provider..?

  But, yes, am sure some of the other list members will have more to offer - I 
myself have no real formal training, and work in a slightly odd sector in terms 
of my own approach - but, will send you a bit more information specific to 
local python activity, off list.

  Stay well

  Jacob Kruger
  Blind Biker
  Skype: BlindZA
  "Roger Wilco wants to welcome you...to the space janitor's closet..."
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: when may sys.executable be empty

2015-03-11 Thread YBM

Le 11/03/2015 15:41, Wolfgang Maier a écrit :

 From the documentation of sys.executable:

 A string giving the absolute path of the executable binary for the
Python interpreter, on systems where this makes sense. If Python is
unable to retrieve the real path to its executable, sys.executable will
be an empty string or None.

So on which systems does it not make sense ?

Thanks for any help,
Wolfgang


On this kind of system (python for microcontroller, running on bare
metal), I guess:

http://micropython.org/
--
https://mail.python.org/mailman/listinfo/python-list


Re: Use à Python 2 module with Python 3

2015-03-11 Thread Ian Kelly
On Wed, Mar 11, 2015 at 4:54 AM, Steven D'Aprano
 wrote:
> Michael Parchet wrote:
>
>> Hello,
>>
>> The pyside project is ded.
>
> What makes you think that Pyside is dead? It seems to be active to me. The
> latest update was just 29 days ago:
>
> https://github.com/PySide

4 days ago, even. Seems that most of the development is still on gitorious:

https://qt.gitorious.org/pyside
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Use à Python 2 module with Python 3

2015-03-11 Thread Michael Parchet

Hello,

Only one file of pyside project has update at 10 fob,

What's your opinion

Pyside is ded ?

Best regards

mparchet


Le 11.03.15 18:06, Ian Kelly a écrit :



On Wed, Mar 11, 2015 at 4:54 AM, Steven D'Aprano
 wrote:

Michael Parchet wrote:


Hello,

The pyside project is ded.

What makes you think that Pyside is dead? It seems to be active to me. The
latest update was just 29 days ago:

https://github.com/PySide

4 days ago, even. Seems that most of the development is still on gitorious:

https://qt.gitorious.org/pyside


--
https://mail.python.org/mailman/listinfo/python-list


Re: when may sys.executable be empty

2015-03-11 Thread Dave Angel

On 03/11/2015 10:41 AM, Wolfgang Maier wrote:

 From the documentation of sys.executable:

 A string giving the absolute path of the executable binary for the
Python interpreter, on systems where this makes sense. If Python is
unable to retrieve the real path to its executable, sys.executable will
be an empty string or None.

So on which systems does it not make sense ?



Just speculating, but how about when the main executable is not python 
at all, but it uses a DLL or .so file with Python interpreter.



--
DaveA
--
https://mail.python.org/mailman/listinfo/python-list


Re: I want to get involved with Python!

2015-03-11 Thread Terry Reedy

On 3/11/2015 5:19 AM, bink...@mweb.co.za wrote:


I am currently a "Progress Programmer" and looking for new challenges!


Are you referring to

https://en.wikipedia.org/wiki/OpenEdge_Advanced_Business_Language


It seems that Python is a good language to get familiar with and I would
like some advice. I am on the look-out for a new job anyway and I
thought it well to look for a job as Python developer in my field. I
have been working in the healthcare sector for many years now and
perhaps the only way to find a job as Python programmer at this stage,
will be to find a job in the healthcare sector, as this is what I am
familiar with. Are there any healthcare companies using Python (anywhere
in the world) that I can contact for opportunities and advice?

I currently live in South Africa and would like to know what the demand
for Python is in SA, but I will also consider relocating to Australia or
the UK if I find it's going to be worth it.

Please advise on what route you would suggest I take to become a Python
developer!


One way to establish credibility as a 'python programmer' is to make 
contributions to an open-source python project.  Perhaps find or create 
a project to somehow integrate Python and Progress.


--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


Re: Use à Python 2 module with Python 3

2015-03-11 Thread Vincent Vande Vyvre

Le 11/03/2015 18:06, Ian Kelly a écrit :

On Wed, Mar 11, 2015 at 4:54 AM, Steven D'Aprano
 wrote:

Michael Parchet wrote:


Hello,

The pyside project is ded.

What makes you think that Pyside is dead? It seems to be active to me. The
latest update was just 29 days ago:

https://github.com/PySide

4 days ago, even. Seems that most of the development is still on gitorious:

https://qt.gitorious.org/pyside


In fact, the devel team of PySide has announced the official abandon of 
the project at the begin of this year.


The announce was made in this page:

http://qt-project.org/wiki/PySide

... but, now, I see this page was reversed to his old content.

So, have a look at the bug tracker and you'll see some comment as this one:

"PySide is abandoned by the initial development team due to a lack of 
funding, so right now the destiny of the bugs such as this is in hands 
of those who understand how to debug them."


(Quoted from https://bugreports.qt.io/browse/PYSIDE-164)

Vincent
--
https://mail.python.org/mailman/listinfo/python-list


Re: Use à Python 2 module with Python 3

2015-03-11 Thread Chris Warrick
On Wed, Mar 11, 2015 at 8:20 PM, Michael Torrie  wrote:
> My biggest complaint with PySide is that for historical reasons (looking
> at you, PyQt), it does not use pep8 naming conventions, which makes for
> some really ugly function and method names.

This isn’t PyQt’s fault.  Both are more-or-less straight bindings to
the underlying C++ Qt library, which does not follow Python’s naming
conventions.

-- 
Chris Warrick 
PGP: 5EAAEA16
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Use à Python 2 module with Python 3

2015-03-11 Thread Michael Torrie
On 03/11/2015 01:29 PM, Chris Warrick wrote:
> On Wed, Mar 11, 2015 at 8:20 PM, Michael Torrie  wrote:
>> My biggest complaint with PySide is that for historical reasons (looking
>> at you, PyQt), it does not use pep8 naming conventions, which makes for
>> some really ugly function and method names.
> 
> This isn’t PyQt’s fault.  Both are more-or-less straight bindings to
> the underlying C++ Qt library, which does not follow Python’s naming
> conventions.

Yes, but they could have simply converted the native Qt names to pep8.
Particularly when the bindings are automatically generated.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Use à Python 2 module with Python 3

2015-03-11 Thread Robert Kern

On 2015-03-11 19:31, Michael Torrie wrote:

On 03/11/2015 01:29 PM, Chris Warrick wrote:

On Wed, Mar 11, 2015 at 8:20 PM, Michael Torrie  wrote:

My biggest complaint with PySide is that for historical reasons (looking
at you, PyQt), it does not use pep8 naming conventions, which makes for
some really ugly function and method names.


This isn’t PyQt’s fault.  Both are more-or-less straight bindings to
the underlying C++ Qt library, which does not follow Python’s naming
conventions.


Yes, but they could have simply converted the native Qt names to pep8.
Particularly when the bindings are automatically generated.


It is *extremely* helpful to have the names be the same in both C++ and PySide 
as the documentation uses the C++ names, as well as every Googleable 
conversation about Qt on the internet. It would be unnecessarily crippling to 
change the names to satisfy a purely optional style guide.


--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco

--
https://mail.python.org/mailman/listinfo/python-list


Re: Use à Python 2 module with Python 3

2015-03-11 Thread Robert Kern

On 2015-03-11 18:46, Vincent Vande Vyvre wrote:

Le 11/03/2015 18:06, Ian Kelly a écrit :

On Wed, Mar 11, 2015 at 4:54 AM, Steven D'Aprano
 wrote:

Michael Parchet wrote:


Hello,

The pyside project is ded.

What makes you think that Pyside is dead? It seems to be active to me. The
latest update was just 29 days ago:

https://github.com/PySide

4 days ago, even. Seems that most of the development is still on gitorious:

https://qt.gitorious.org/pyside


In fact, the devel team of PySide has announced the official abandon of the
project at the begin of this year.

The announce was made in this page:

http://qt-project.org/wiki/PySide

... but, now, I see this page was reversed to his old content.


Indeed, because that comment was not placed there by the PySide dev team.


So, have a look at the bug tracker and you'll see some comment as this one:

"PySide is abandoned by the initial development team due to a lack of funding,
so right now the destiny of the bugs such as this is in hands of those who
understand how to debug them."

(Quoted from https://bugreports.qt.io/browse/PYSIDE-164)


Anatoly was wrong.

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco

--
https://mail.python.org/mailman/listinfo/python-list


Re: MSVC2013

2015-03-11 Thread polyvertex
On Sunday, March 8, 2015 at 7:51:17 PM UTC+1, Mark Lawrence wrote:
> On 08/03/2015 17:57, polyver...@gmail.com wrote:
> > On Saturday, March 7, 2015 at 5:36:07 PM UTC+1, Mark Lawrence wrote:
> >> On 07/03/2015 15:55, polyver...@gmail.com wrote:
> >>> Out of curiosity, is there any plan to use a more recent version of 
> >>> Visual Studio (i.e.: 2013) to compile the official Python3 distribution 
> >>> for Windows?
> >>> Is it in discussion? Maybe waiting for the 2015 version?
> >>>
> >>> I'm working on a C++ software that embeds Python3, currently compiled 
> >>> with MSVC2010 and would like to upgrade to MSVC2013, but it appears that, 
> >>> while being feasible, Python3 won't compile out of the box with that 
> >>> configuration. I would like to avoid that hassle if possible...
> >>>
> >>> Cheers,
> >>>
> >>
> >> I'm building Python 3.5 every day with 2013 no problems at all, thanks
> >> mainly to the work on the build system by Zach Ware and Steve Dower.  If
> >> 2015 is stable that will be used for 3.5 else we'll stick with 2013.
> >>
> >> --
> >> My fellow Pythonistas, ask not what our language can do for you, ask
> >> what you can do for our language.
> >>
> >> Mark Lawrence
> >
> > For the record, I successfully compiled v3.5.0a1 (the latest 3.5 candidate 
> > as of today) with a fresh install of msvc2013. I ran the 
> > PCbuild/get_externals.bat script manually then opened the pcbuild.sln to 
> > launch a "Release/x64" build.
> >
> > Note that I had to launch the global build twice since the first one failed 
> > due to  header not found during _tkinter build. Re-launching the 
> > global build without modifying any setting/property just did the job 
> > flawlessly.
> >
> 
> http://bugs.python.org/issue23452
> 
> > As a quick test, I copied the built binaries (python.exe, .dll and .pyd 
> > files) in a new directory, as well as the content of the Lib folder. Then I 
> > started an interpreter session and typed some random imports. It all worked 
> > like a charm.
> >
> > Thank you for your answers.
> >
> 
> No problem :)
> 
> -- 
> My fellow Pythonistas, ask not what our language can do for you, ask
> what you can do for our language.
> 
> Mark Lawrence

It seems I encountered issue #17797:
http://bugs.python.org/issue17797

Should I update the bug with my config? (i.e.: native x64 GUI application 
embedding version 3.5a2, built with MSVC2013 SP4)
Don't even know if I can as a guest...

It is unclear to me whether or not a workaround will be implemented in 3.5 
branch for pre-MSVC2015 compilers.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: MSVC2013

2015-03-11 Thread Mark Lawrence

On 11/03/2015 21:59, polyver...@gmail.com wrote:

On Sunday, March 8, 2015 at 7:51:17 PM UTC+1, Mark Lawrence wrote:

On 08/03/2015 17:57, polyver...@gmail.com wrote:

On Saturday, March 7, 2015 at 5:36:07 PM UTC+1, Mark Lawrence wrote:

On 07/03/2015 15:55, polyver...@gmail.com wrote:

Out of curiosity, is there any plan to use a more recent version of Visual 
Studio (i.e.: 2013) to compile the official Python3 distribution for Windows?
Is it in discussion? Maybe waiting for the 2015 version?

I'm working on a C++ software that embeds Python3, currently compiled with 
MSVC2010 and would like to upgrade to MSVC2013, but it appears that, while 
being feasible, Python3 won't compile out of the box with that configuration. I 
would like to avoid that hassle if possible...

Cheers,



I'm building Python 3.5 every day with 2013 no problems at all, thanks
mainly to the work on the build system by Zach Ware and Steve Dower.  If
2015 is stable that will be used for 3.5 else we'll stick with 2013.

--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence


For the record, I successfully compiled v3.5.0a1 (the latest 3.5 candidate as of today) 
with a fresh install of msvc2013. I ran the PCbuild/get_externals.bat script manually 
then opened the pcbuild.sln to launch a "Release/x64" build.

Note that I had to launch the global build twice since the first one failed due to 
 header not found during _tkinter build. Re-launching the global build 
without modifying any setting/property just did the job flawlessly.



http://bugs.python.org/issue23452


As a quick test, I copied the built binaries (python.exe, .dll and .pyd files) 
in a new directory, as well as the content of the Lib folder. Then I started an 
interpreter session and typed some random imports. It all worked like a charm.

Thank you for your answers.



No problem :)

--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence


It seems I encountered issue #17797:
http://bugs.python.org/issue17797

Should I update the bug with my config? (i.e.: native x64 GUI application 
embedding version 3.5a2, built with MSVC2013 SP4)
Don't even know if I can as a guest...


Just create yourself a login, doesn't take five minutes, ask the 
occasional spammer who gets in :)




It is unclear to me whether or not a workaround will be implemented in 3.5 
branch for pre-MSVC2015 compilers.



I would think not but please don't quote me on that, it's all down to 
the Windows core developers.


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


__new__() does not return anything, on singletong pattern

2015-03-11 Thread Mario Figueiredo
I'm fairly new to Python, so I don't know if the following is me
abusing the programming language idioms, or simply a mistake of my IDE
code inspection routine.

I have a singleton Map class which is defined like so:

class Map:
_instance = None

def __new__(cls):
if Map._instance is None:
Map._instance = super(Map, cls).__new__(cls)

return Map._instance

def __init__(self, filename):
# Instantiates from the contents of a binary file

I am now trying to add another way of constructing an instance of this
class. (I need to be able to create a dirty empty instance that is
going to be used by the separate map editor script).

I added the following method to the class definition, above:

@classmethod
def generate(cls, width, height, fill=terrain[6]):
if Map._instance is None:
Map._instance = super(Map, cls).__new__(cls)
else:
raise Exception('Cannot generate an instance of Map.')

Map._instance.author = None
Map._instance.name = None
Map._instance.description = None
# etc...

self.cells = [Cell(fill)] * width * height

return Map._instance


The following code runs just fine. But PyCharm flags the assignment
with a warning telling me that generate() does not return anything and
the I lose code completion on the mmap variable.

if __name__ == '__main__':
mmap = Map.generate(12, 24)
print(mmap.width, mmap.height, mmap.author)

I need to understand if this is just a glitch of the IDE or I am doing
indeed something that is frowned upon and ended up caught in a
misleading static analysis warning.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: __new__() does not return anything, on singletong pattern

2015-03-11 Thread Ethan Furman
On 03/11/2015 04:33 PM, Mario Figueiredo wrote:

> The following code runs just fine. But PyCharm flags the assignment
> with a warning telling me that generate() does not return anything and
> the I lose code completion on the mmap variable.
> 
> if __name__ == '__main__':
> mmap = Map.generate(12, 24)
> print(mmap.width, mmap.height, mmap.author)
> 
> I need to understand if this is just a glitch of the IDE or I am doing
> indeed something that is frowned upon and ended up caught in a
> misleading static analysis warning.

You're code is good.  The only question is if you /really/ need a singleton -- 
and only you can answer that (although
plenty of folks will tell you you don't ;) .

--
~Ethan~



signature.asc
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: I want to get involved with Python!

2015-03-11 Thread Frank Millman
Original Message - From:bink...@mweb.co.zato:python-list@python.orgSent: 
Wednesday, March 11, 2015 11:19 AMSubject: I want to get involved with 
Python!
> Please advise on what route you would suggest I take to become a Python > 
>  > developer!
>
> Thanks,
> Bianca.

There is a Capetown Python User Group and a Gauteng Python User Group. They 
both use Google Groups for communication -

http://groups.google.com/group/ctpug.

http://groups.google.com/group/gpugsa

It is worth subscribing to both. Jobs are advertised from time to time 
(mostly in Capetown). Have a look through the archives.

Both groups organise monthly meetings - a good opportunity to mix with other 
Python developers.

Frank Millman



-- 
https://mail.python.org/mailman/listinfo/python-list


Re: __new__() does not return anything, on singletong pattern

2015-03-11 Thread Steven D'Aprano
Mario Figueiredo wrote:

> I'm fairly new to Python, so I don't know if the following is me
> abusing the programming language idioms, or simply a mistake of my IDE
> code inspection routine.
> 
> I have a singleton Map class which is defined like so:
> 
> class Map:
> _instance = None
> def __new__(cls):
> if Map._instance is None:
> Map._instance = super(Map, cls).__new__(cls)
> return Map._instance

In Python 2, you need to inherit from object for __new__ to be called. In 
Python 3, it doesn't matter.

> def __init__(self, filename):
> # Instantiates from the contents of a binary file
> 
> I am now trying to add another way of constructing an instance of this
> class. (I need to be able to create a dirty empty instance that is
> going to be used by the separate map editor script).

If this is supposed to be a singleton, you can't create more instances. The 
point of a singleton that there is only one instance (or perhaps a small 
number, two or three say). Why do you need two different ways to create 
instances if you only have one instance?


> I added the following method to the class definition, above:
> 
> @classmethod
> def generate(cls, width, height, fill=terrain[6]):
> if Map._instance is None:
> Map._instance = super(Map, cls).__new__(cls)
> else:
> raise Exception('Cannot generate an instance of Map.')
> 
> Map._instance.author = None
> Map._instance.name = None

Since this method modifies the singleton instance in place, it doesn't 
generate a new instance. It shouldn't be called generate(). In fact since 
this is a singleton, the method shouldn't exist at all. Just put the 
initialisation code in __new__, drop the __init__ and generate methods, and 
call Map(argument).


def __new__(cls, width, height, fill=terrain[6]):
if Map._instance is None:
instance = Map._instance = super(Map, cls).__new__(cls)
instance.author = None
instance.name = None 
instance.description = None
instance.cells = [Cell(fill)] * width * height
else:
# Ignore the arguments. Why are you passing different arguments
# to a singleton class? Bleh.
instance = Map._instance
return instance



> Map._instance.description = None
>  # etc...
>  self.cells = [Cell(fill)] * width * height
> return Map._instance

That's not your actual code, since the indentation is wrong. What does your 
actual code look like? You are running PyCharm on one piece of code, then 
showing us *different* (edited) code. We cannot see what PyCharm sees, so 
how do we know why PyCharm says what it says?


> The following code runs just fine. But PyCharm flags the assignment
> with a warning telling me that generate() does not return anything and
> the I lose code completion on the mmap variable.
> 
> if __name__ == '__main__':
> mmap = Map.generate(12, 24)
> print(mmap.width, mmap.height, mmap.author)
> 
> I need to understand if this is just a glitch of the IDE or I am doing
> indeed something that is frowned upon and ended up caught in a
> misleading static analysis warning.


Probably.

-- 
Steve

-- 
https://mail.python.org/mailman/listinfo/python-list


RE: Re: I want to get involved with Python!

2015-03-11 Thread bink...@mweb.co.za
Thanks, everyone, for the advice so far - I am impressed with the way everyone 
wants to help!
From: fr...@chagford.com
Sent: 2015/03/12 07:29:46 AM
To: python-list@python.org
Cc:
Subject: RE: Re: I want to get involved with Python!  Original Message - 
From:bink...@mweb.co.zato:python-list@python.orgSent: 
Wednesday, March 11, 2015 11:19 AMSubject: I want to get involved with 
Python!
> Please advise on what route you would suggest I take to become a Python > 
> > developer!
>
> Thanks,
> Bianca.

There is a Capetown Python User Group and a Gauteng Python User Group. They 
both use Google Groups for communication -

http://groups.google.com/group/ctpug.

http://groups.google.com/group/gpugsa

It is worth subscribing to both. Jobs are advertised from time to time 
(mostly in Capetown). Have a look through the archives.

Both groups organise monthly meetings - a good opportunity to mix with other 
Python developers.

Frank Millman



-- 
https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list